import config from './config'
export default function({url,method='get',data={}}){
  return new Promise((resolve,reject)=>{
    wx.request({
      url: config.baseUrl + url,
      data,
      method,
      header:{   //携带cookie的请求头
        cookie:"MUSIC_U=28efb1c90c4ae706988abdfa109dfd706c87265fc8b85926f9b726a357a42b211e8907c67206e1ed45d2f9e9644cc9d31779c9984285567927da1ef993dd72b3f3659ea6a5a8f850a0d2166338885bd7"
      },
      success(res){
        resolve(res.data)
      },
      fail(error){
        reject(error)
      }
    })
  })
}